config:
  stages: [build, test, review, deploy]

  build:
    stage: build
    script: exit 0

  test:
    stage: test
    script: exit 0

  release_test:
    stage: test
    when: manual
    allow_failure: true
    script: exit 0

  review:
    stage: review
    script: exit 0
    needs: [test, release_test]

  staging:
    stage: deploy
    script: exit 0
    needs: [test, release_test]

  production:
    stage: deploy
    script: exit 0
    needs: [review]

init:
  expect:
    pipeline: pending
    stages:
      build: pending
      test: created
      review: created
      deploy: created
    jobs:
      build: pending
      test: created
      release_test: created
      review: created
      staging: created
      production: created

transitions:
  - event: success
    jobs: [build]
    expect:
      pipeline: running
      stages:
        build: success
        test: pending
        review: skipped
        deploy: skipped
      jobs:
        build: success
        test: pending
        release_test: manual
        review: skipped
        staging: skipped
        production: skipped

  - event: success
    jobs: [test]
    expect:
      pipeline: success
      stages:
        build: success
        test: success
        review: skipped
        deploy: skipped
      jobs:
        build: success
        test: success
        release_test: manual
        review: skipped
        staging: skipped
        production: skipped
